From d3f3f4e80d338133a2083dd5c267ed456b86303d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Florian=20M=C3=BCllner?= Date: Wed, 22 Oct 2025 00:57:26 +0200 Subject: [PATCH] systemActions: Don't log error when cancelled If the logout/reboot/shutdown actions are available, we expect them to succeed. Unfortunately that changed in the light of systemd inhibitors (that we don't know about in the shell, and that prevent those actions now). While it would be good to fix the underlying issue, we can at least improve the error reporting in that case and not log the error when the operation was cancelled: We don't know the underlying reason, unlike gnome-session which should have logged a more helpful message. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8749 Part-of: --- js/misc/systemActions.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js index ae0268903..710d42fa5 100644 --- a/js/misc/systemActions.js +++ b/js/misc/systemActions.js @@ -5,6 +5,7 @@ import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; +import {logErrorUnlessCancelled} from './errorUtils.js'; import * as GnomeSession from './gnomeSession.js'; import * as LoginManager from './loginManager.js'; import * as Main from '../ui/main.js'; @@ -448,21 +449,21 @@ const SystemActions = GObject.registerClass({ throw new Error('The logout action is not available!'); Main.overview.hide(); - this._session.LogoutAsync(0).catch(logError); + this._session.LogoutAsync(0).catch(logErrorUnlessCancelled); } activatePowerOff() { if (!this._actions.get(POWER_OFF_ACTION_ID).available) throw new Error('The power-off action is not available!'); - this._session.ShutdownAsync(0).catch(logError); + this._session.ShutdownAsync(0).catch(logErrorUnlessCancelled); } activateRestart() { if (!this._actions.get(RESTART_ACTION_ID).available) throw new Error('The restart action is not available!'); - this._session.RebootAsync().catch(logError); + this._session.RebootAsync().catch(logErrorUnlessCancelled); } activateSuspend() { -- 2.39.5